﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProjectStorageDB;

namespace ProjectStorageLib.Practices
{
    public class PracticeManager : DatabaseEntities
    {
        public PracticeManager()
            : base()
        { }

        protected override void Dispose(bool flag)
        {

        }

        public List<ProjectStorageDB.AgilePrinciples> GetPrinciplesCoverage(List<decimal> practiceids)
        {
            return (from pc in ent.PracticeAgilePrinciplesCoverage join pr in practiceids on pc.IDPractice equals pr where pc.IsCovered == true select pc.AgilePrinciples).Distinct().ToList();
        }

        public List<ProjectStorageDB.AgileValues> GetValuesCoverage(List<decimal> practiceids)
        {
            return (from pc in ent.PracticeAgilePrinciplesCoverage join pr in practiceids on pc.IDPractice equals pr where pc.IsCovered == true select pc.AgileValues).Distinct().ToList();
        }

        public List<ProjectStorageDB.ProcessActivities> GetActivitiesCoverage(List<decimal> practiceids)
        {
            return (from pc in ent.PracticeActivitiesCoverage join pr in practiceids on pc.IDPractice equals pr where pc.IsCovered == true select pc.ProcessActivities ).Distinct().ToList();
        }

        public List<ProjectStorageDB.ProcessDisciplines> GetDisciplinesCoverage(List<decimal> practiceids)
        {
            return (from pc in ent.PracticeDisciplinesCoverage join pr in practiceids on pc.IDPractice equals pr where pc.IsCovered == true select pc.ProcessDisciplines).Distinct().ToList();
        }

    }
}
